#ifndef USINE_H
#define USINE_H

#include <QVector>

template<class T> class Usine
{
private:
    QVector<T*> v;
public:
    Usine()
    {
        v = QVector<T*>();
    }
    ~Usine()
    {
        for (int i = 0; i < v.size(); i++)
        {
            delete v[i];
        }
        v.clear();
    }
    void append(T* x)
    {
        v.append(x);
    }
    void remove(int i)
    {
        delete v[i];
        v.remove(i);
    }
    int size()
    {
        return v.size();
    }
    T* operator[](int i) { return v[i]; }
    const T* operator[](int i) const { return v[i]; }
    QVector<T*>& get() { return v; }
    const QVector<T*>& get() const { return v; }
};

#endif // USINE_H
